$(function() {
  //全局变量
  var arrTable = new Object(),
    ryFz = new Object(),
    ryfzUser = new Object(),
    rows = 0, //排座表单行
    cols = 0, //排座表单列
    fzStyle = "", //分组名称 LR S
    fzName = 0, //分组方式标识 对应ryfzid
    userList = [], //分组人员
    close = true, //是否关闭弹窗标识
    sFlag=true,//s型排座方向标识
    iniArr = []; //起始位置存放数组
  (FZ = document.getElementById("FZ")),
    (tbody = document.querySelector("#arrTable"));

  //渲染座表
  function creatSeat() {
    //坐席表长度
    dataLen = arrTable.Data.length;
    rows = arrTable.Data[dataLen - 1].row;
    cols = arrTable.Data[dataLen - 1].col;
    if ((rows == 0) & (cols == 0)) {
      return;
    } else {
      tbody.innerHTML = " ";
      for (var x = 0; x < rows; x++) {
        var trNode = tbody.insertRow();
        var xx = 0;
        xx+=x*cols;
        for (var y = 0; y < cols; y++) {
          var tdNode = trNode.insertCell();
          var tds = $("#arrTable td");
          tdNode.setAttribute("xh", xx+ y);
          tdNode.setAttribute("row", x + 1);
          tdNode.setAttribute("col", y + 1);
          for (var i = 0; i < tds.length; i++) {
            (function(i) {
              tds.eq(i).attr("symbol", arrTable.Data[i].symbol);
              switch (arrTable.Data[i].symbol) {
                case 1:
                  tds
                    .eq(i)
                    .html("<div>" + "<img src='../shexiang.png'>" + "</div>");
                  break;
                case 2:
                  tds.eq(i).html("<div>"+ "</div>");
                  break;
                case 3:
                  tds.eq(i).html("<div>" + "<img src='../zw.png'>" + "</div>");
                  break;
                case 4:
                  tds
                    .eq(i)
                    .html("<div>" + "<img src='../dengdai.png'>" + "</div>");
                  break;
                case 5:
                  tds
                    .eq(i)
                    .html("<div>" + "<img src='../renyuan.png'>" + "</div>");
                  break;
              }
            })(i);
          }
        }
      }
      document.onselectstart = function() {
        return false;
      };
      window.getSelection
        ? window.getSelection().removeAllRanges()
        : document.selection.empty();
      cellClick();
    }
  }
  // 单元格点击事件
  function cellClick() {
    tds = $("#arrTable td");
    for (let i = 0; i < tds.length; i++) {
      tds.eq(i).click(function() {
        console.log(this);
      });
    }
  }
  //每个座位显示名字
  function disPlay() {
    for(let i=0;i<arrTable.Data.length;i++){
      if(arrTable.Data[i].name){
        if(arrTable.Data[i].name.length>3){tds.eq(i).css("line-height","20px")}else
        {tds.eq(i).css("line-height","40px")}
        tds.eq(i).html("<div>" +"<img src='../zw.png'>"+ "<span>" + arrTable.Data[i].name + "</div>" + "</span>");}
    }
  }
  //排序
  function reOrder() {
    //存放坐席的数组
     seatList = [];
     seatListIndex = [];
     seatListRow =[];
    for(let i =0;i<dataLen;i++){
    if(arrTable.Data[i].symbol=="3"){
      seatList.push(arrTable.Data[i])
      seatListIndex.push(i);
      seatListRow.push(arrTable.Data[i].row)
    }
  }
    if (fzStyle.length == 0 || userList.length == 0) {
      alert("请输入完整");
    } else {  
      if (fzStyle == "S") {
        sReorder();      
    }
      if(fzStyle == "LR"){
        lrReorder(iniArr);
      }
  }
  //S型排序
  function sReorder(){
    if(iniArr.length<userList.length){alert("所选座位不足");return;}
    var fontOver=[],//userList.name超过三个字的index存放数组
        iniIndex=[],//所选iniArr的index存放数组
        sRow=[],//存放iniArr的row信息
        k=0;
    var r=iniArr[0].row;
    for(let i=0;i<iniArr.length;i++){
      var r = iniArr[i].row
      if(sRow.indexOf(r) == -1){sRow.push(r)}
    }
    for(let i=0;i<userList.length;i++){
      var str = userList[i].name
      if(str.length>3){
        fontOver.push(i);
      }
    }
    for(let i=0;i<iniArr.length;i++){
      var item = Number(iniArr[i].xh)
        iniIndex.push(item);
    } 
    for(let j=0;j<sRow.length;j++){
      __sOrder(sRow[j]-1)  
    function __sOrder(row){
      for(let i=row*cols;i<(row+1)*cols;i++){            
        if(iniIndex.indexOf(i) != -1 && k<userList.length){
          if(fontOver.indexOf(k) != -1){tds.eq(i).css("line-height","20px")}else{tds.eq(i).css("line-height","40px")}
          tds.eq(i).html("<div>" +"<img src='../zw.png'>"+ "<span>" + userList[k].name + "</div>" + "</span>");
          arrTable.Data[i].name=userList[k].name;
          arrTable.Data[i].xh=userList[k].xh;
          arrTable.Data[i].ryfzid=userList[k].ryfzid;
          arrTable.Data[i].useruuid=userList[k].useruuid;
          k++;
        }
      }
      // if(sFlag){
      //   sFlag=false;
      //   for(let i=row*cols;i<(row+1)*cols;i++){            
      //     if(iniIndex.indexOf(i) != -1 && k<userList.length){
      //       if(fontOver.indexOf(k) != -1){tds.eq(i).css("line-height","20px")}else{tds.eq(i).css("line-height","40px")}
      //       tds.eq(i).html("<div>" +"<img src='../zw.png'>"+ "<span>" + userList[k].name + "</div>" + "</span>");
      //       arrTable.Data[i].name=userList[k].name;
      //       k++;
      //     }
      //   }
      // }else{ 
      //   sFlag=true;
      //   for(let i=(row+1)*cols-1;i>=row*cols;i--){
      //     if(iniIndex.indexOf(i) != -1 && k<userList.length){
      //       if(fontOver.indexOf(k) != -1){tds.eq(i).css("line-height","20px")}else{tds.eq(i).css("line-height","40px")}
      //       tds.eq(i).html("<div>" +"<img src='../zw.png'>"+ "<span>" + userList[k].name + "</div>" + "</span>");
      //       arrTable.Data[i].name=userList[k].name;         
      //       k++;
      //     }
      //   }
      // }
    }
  }
  cellClick();
 }

 //LR排序
 function lrReorder(iniArr) {
  if(iniArr.length<userList.length){alert("所选座位不足");return;}
   var fontOver = [],
       iniIndex = [],
       sRow = [],
       middle,
       c = 1,
       b = 0,
       k = 0;
   for (let i = 0; i < userList.length; i++) {
     var str = userList[i].name;
     if (str.length > 3) {
       fontOver.push(i);
     }
   }
   for (let i = 0; i < iniArr.length; i++) {
     var r = iniArr[i].row;
     if (sRow.indexOf(r) == -1) {
       sRow.push(r);
     }
   }
   for (let i = 0; i < iniArr.length; i++) {
     var item = Number(iniArr[i].xh);
     iniIndex.push(item);
   }
   for (let j = 0; j < sRow.length; j++) {
     __lrOrder(sRow[j] - 1);
   }
   function __lrOrder(row) {
       b=k;
       c=b+1;
     var a = [];
     for (let i = row * cols; i < (row + 1) * cols; i++) {
       if (iniIndex.indexOf(i) != -1) {
         a.push(i);
       }
       middle = a[Math.floor(a.length/2)]
     }
     for(let i=middle;i<(row+1)*cols;i++){
      if (iniIndex.indexOf(i) != -1 && b < userList.length){
        if(fontOver.indexOf(b) != -1){tds.eq(i).css("line-height","20px")}else{tds.eq(i).css("line-height","40px")}
           tds.eq(i).html("<div>" +"<img src='../zw.png'>"+ "<span>" + userList[b].name + "</div>" + "</span>");
           arrTable.Data[i].name=userList[b].name;
           arrTable.Data[i].xh=userList[b].xh;
           arrTable.Data[i].ryfzid=userList[b].ryfzid;
           arrTable.Data[i].useruuid=userList[b].useruuid;
           b+=2;
           k++;
      }
     }
     for(let i=middle-1;i>row*cols-1;i--){
      if (iniIndex.indexOf(i) != -1 && c < userList.length){    
        if(fontOver.indexOf(c) != -1){tds.eq(i).css("line-height","20px")}else{tds.eq(i).css("line-height","40px")}
           tds.eq(i).html("<div>" +"<img src='../zw.png'>"+ "<span>" + userList[c].name + "</div>" + "</span>");
           arrTable.Data[i].name=userList[c].name;
           arrTable.Data[i].xh=userList[c].xh;
           arrTable.Data[i].ryfzid=userList[c].ryfzid;
           arrTable.Data[i].useruuid=userList[c].useruuid;
           c+=2;
           k++;
       }
     }
   }
 }
cellClick();
}


  //导入数据按钮点击事件
  $("#import").click(function() {
    clearPopData();
    $(".popup").addClass("Show");
    fillSelect(FZ, ryFz.Data);
  });
  //确定起始位置
  $("#iniSelect").click(function() {
    close = false;
    var top;
    getTop()
    $(".popup")
      .stop()
      .animate({ top: top}, 1000);
    tds.unbind(iniSelect());
    iniSelect();
    //确定弹出框位置
    function getTop(){
      var arrSeat= document.querySelectorAll(".arrSeats")[0]
      var height=getStyle(arrSeat,"height")
      top = parseInt(height)+230
    }
  });
  function iniSelect() {
    for (let i = 0; i < tds.length; i++) {
      (function() {
        if (tds.eq(i).attr("symbol") == "3") {
          //是否点击标识
          tds.eq(i).css("background", "rgb(62, 243, 116)");
          tds.eq(i).attr("iniClick", "1");
          tds.eq(i).click(function() {
            if ($(this).attr("iniClick") == "2") {
              $(this).css("background", "rgb(62,243,116)");
              $(this).attr("iniClick", "1");
            } else {
              $(this).css("background", "red");
              $(this).attr("iniClick", 2);
            }
          });
        }
      })(i);
    }
  }
  //将确定的初始位置存入数组
  function fillIniArray() {
    tds.each(function(index, item) {
      if ($(this).attr("iniClick") == 2) {
        var iniPos = {};
        iniPos.row = $(this).attr("row");
        iniPos.col = $(this).attr("col");
        iniPos.xh = $(this).attr("xh");
        iniArr.push(iniPos);
      }
    });
  }
  //确定分组方式
  $("#S").click(function() {
    fzStyle = "S";
    $(this).addClass("active");
    $("#LR").removeClass("active");
    $("#ensureSelect").css("display", "block");
    $("#ensureSelect__S").css("display", "inline-block");
    $("#ensureSelect__LR").css("display", "none");
    $("#LR").css("display", "none");
  });
  $("#LR").click(function() {
    fzStyle = "LR";
    $(this).addClass("active");
    $("#S").removeClass("active");
    $("#ensureSelect").css("display", "block");
    $("#ensureSelect__LR").css("display", "inline-block");
    $("#ensureSelect__S").css("display", "none");
    $("#S").css("display", "none");
  });
  //添加分组名称
  function fillSelect(select, list) {
    list.forEach(function(item) {
      if (item.ryfzname) {
        let option = new Option(item.ryfzname, item.ryfzid);
        select.add(option);
      }
    });
  }
  $("#FZ").change(function() {
    userList = [];
    fzName = $(this).val();
  });
  //确定分组人员
  function peopleList(data) {
    if (fzName & (fzName != 9999)) {
      data.forEach(function(item) {
        if (fzName == item.ryfzid) {
          let user = {};
          user.xh=item.xh;
          user.ryfzid=item.ryfzid;
          user.useruuid = item.useruuid;
          user.name = item.name;
          userList.push(user);
        }
      });
    } else {
      return;
    }
  }
  //确定按钮点击
  $(".popup__button")
    .eq(0)
    .click(function() {
      close = true; 
  // 根据fzName向后台请求ryfzUser 
      // getRyfzUser(fzName);
      peopleList(ryfzUser.Data);
      fillIniArray();
      reOrder();
      clearPop();
      clearPopData();
    });
  //隐藏弹出框和重置分组数据
  $(".arrSeats").click(function() {
    clearPop();
  });
  $(".popup__button")
    .eq(1)
    .click(function() {
      close = true;
      clearPop();
    });
  function clearPop() {
    clearPopData();
    if (close) {
      $(".popup").removeClass("Show");
    }
  }
  function clearPopData() {
    if (close) {
      for (let i = 0; i < tds.length; i++) {
        tds.eq(i).css({"background": "#fff"});
      }
      $(".popup").css("top", "50%");
      $("#LR").css("display", "inline-block");
      $("#S").css("display", "inline-block");
      iniArr = [];
      $("#ensureSelect").css("display", "none");
      FZ.innerHTML = "<option value=" + "9999" + ">--选择分组--</option>";
      $("#S").removeClass("active");
      $("#LR").removeClass("active");
      fzStyle = "";
      fzName = 0;
      userList = [];
      sFlag=true;
    }
  }
//获取宽高函数
  function getStyle(elem, cssname) {
    if (window.getComputedStyle) {
        return window.getComputedStyle(elem)[cssname]
    } else {
        return elem.currentStyle[cssname]
    }
}

//nav栏
//保存按钮点击
$(".btn").eq(1).click(function(){
  saveBtn(arrTable)
})
function saveBtn(data){
  // $.ajax({
    //         type: 'post',
    //         contentType: "application/x-www-form-urlencoded; charset=utf-8",
    //         url: 'http://192.168.160.80:8080/mtgp/seating_queryPxRyfz?mtgid='+arrTable.mtgid,
    //         async:false,
    //         dataType:'json',
    //         data:data,
    //         success: function(data){
    //            alert("保存成功")
    //             }
    //         }
    //     });
}
//重置按钮点击
$(".btn").eq(2).click(function(){
  $("#printDetail").empty();
  creatSeat();
  for(let i=0;i<arrTable.Data.length;i++){
    arrTable.Data[i].name=null; 
    arrTable.Data[i].xh=null;
    arrTable.Data[i].ryfzid=null;
    arrTable.Data[i].useruuid=null;
  }
})
//预览按钮点击
$(".btn").eq(0).click(function(){
  var previewTable = arrTable;
  //ajax previewTable入库 现在省略
  window.open("../preview/preview.html");
})
//打印人员名单
$(".btn").eq(5).click(function() {
  $("article nav").addClass("Hide");
  window.print();
  $("article nav").removeClass("Hide");
});
$(".btn").eq(7).click(function() {
    var printName = [];
    for (let i = 0; i < dataLen; i++) {
      if (arrTable.Data[i].name) {
        var name={}
        name.val = arrTable.Data[i].name;
        printName.push(name);
      }
    }
    if (printName.length > 0) {
      $("article").addClass("Hide");
      $("article nav").addClass("Hide");
      renderUser();
      doPrint(); 
      $("article").removeClass("Hide");
      $("article nav").removeClass("Hide");
      $("#printDetail").empty();
    } else {
      alert("请先导入数据");
    }
    function doPrint() {
       window.print();
    }
    function renderUser() {
      for (let i = 0; i < printName.length; i++) {
        var name = printName[i].val
        $("#printDetail").append("<p>" + name + "</p>");
      }
    }
  });











  //ajax
  //获取表单模板seatTable
  arrTable = {"mtgid":1,"meet_model_id":1,"Data":[{"xh":0,"row":1,"col":1,"symbol":2},{"xh":1,"row":1,"col":2,"symbol":2},{"xh":2,"row":1,"col":3,"symbol":2},{"xh":3,"row":1,"col":4,"symbol":2},{"xh":4,"row":1,"col":5,"symbol":2},{"xh":5,"row":1,"col":6,"symbol":2},{"xh":6,"row":1,"col":7,"symbol":2},{"xh":7,"row":1,"col":8,"symbol":3},{"xh":8,"row":1,"col":9,"symbol":3},{"xh":9,"row":1,"col":10,"symbol":3},{"xh":10,"row":1,"col":11,"symbol":3},{"xh":11,"row":1,"col":12,"symbol":3},{"xh":12,"row":1,"col":13,"symbol":3},{"xh":13,"row":1,"col":14,"symbol":3},{"xh":14,"row":1,"col":15,"symbol":3},{"xh":15,"row":1,"col":16,"symbol":2},{"xh":16,"row":1,"col":17,"symbol":2},{"xh":17,"row":1,"col":18,"symbol":2},{"xh":18,"row":1,"col":19,"symbol":2},{"xh":19,"row":1,"col":20,"symbol":2},{"xh":20,"row":1,"col":21,"symbol":2},{"xh":21,"row":1,"col":22,"symbol":2},{"xh":22,"row":2,"col":1,"symbol":2},{"xh":23,"row":2,"col":2,"symbol":2},{"xh":24,"row":2,"col":3,"symbol":2},{"xh":25,"row":2,"col":4,"symbol":2},{"xh":26,"row":2,"col":5,"symbol":2},{"xh":27,"row":2,"col":6,"symbol":2},{"xh":28,"row":2,"col":7,"symbol":2},{"xh":29,"row":2,"col":8,"symbol":2},{"xh":30,"row":2,"col":9,"symbol":2},{"xh":31,"row":2,"col":10,"symbol":2},{"xh":32,"row":2,"col":11,"symbol":2},{"xh":33,"row":2,"col":12,"symbol":2},{"xh":34,"row":2,"col":13,"symbol":2},{"xh":35,"row":2,"col":14,"symbol":2},{"xh":36,"row":2,"col":15,"symbol":2},{"xh":37,"row":2,"col":16,"symbol":2},{"xh":38,"row":2,"col":17,"symbol":2},{"xh":39,"row":2,"col":18,"symbol":2},{"xh":40,"row":2,"col":19,"symbol":2},{"xh":41,"row":2,"col":20,"symbol":2},{"xh":42,"row":2,"col":21,"symbol":2},{"xh":43,"row":2,"col":22,"symbol":2},{"xh":44,"row":3,"col":1,"symbol":3},{"xh":45,"row":3,"col":2,"symbol":3},{"xh":46,"row":3,"col":3,"symbol":3},{"xh":47,"row":3,"col":4,"symbol":3},{"xh":48,"row":3,"col":5,"symbol":3},{"xh":49,"row":3,"col":6,"symbol":3},{"xh":50,"row":3,"col":7,"symbol":2},{"xh":51,"row":3,"col":8,"symbol":3},{"xh":52,"row":3,"col":9,"symbol":3},{"xh":53,"row":3,"col":10,"symbol":3},{"xh":54,"row":3,"col":11,"symbol":3},{"xh":55,"row":3,"col":12,"symbol":3},{"xh":56,"row":3,"col":13,"symbol":3},{"xh":57,"row":3,"col":14,"symbol":3},{"xh":58,"row":3,"col":15,"symbol":3},{"xh":59,"row":3,"col":16,"symbol":2},{"xh":60,"row":3,"col":17,"symbol":3},{"xh":61,"row":3,"col":18,"symbol":3},{"xh":62,"row":3,"col":19,"symbol":3},{"xh":63,"row":3,"col":20,"symbol":3},{"xh":64,"row":3,"col":21,"symbol":3},{"xh":65,"row":3,"col":22,"symbol":3},{"xh":66,"row":4,"col":1,"symbol":3},{"xh":67,"row":4,"col":2,"symbol":3},{"xh":68,"row":4,"col":3,"symbol":3},{"xh":69,"row":4,"col":4,"symbol":3},{"xh":70,"row":4,"col":5,"symbol":3},{"xh":71,"row":4,"col":6,"symbol":3},{"xh":72,"row":4,"col":7,"symbol":2},{"xh":73,"row":4,"col":8,"symbol":3},{"xh":74,"row":4,"col":9,"symbol":3},{"xh":75,"row":4,"col":10,"symbol":3},{"xh":76,"row":4,"col":11,"symbol":3},{"xh":77,"row":4,"col":12,"symbol":3},{"xh":78,"row":4,"col":13,"symbol":3},{"xh":79,"row":4,"col":14,"symbol":3},{"xh":80,"row":4,"col":15,"symbol":3},{"xh":81,"row":4,"col":16,"symbol":2},{"xh":82,"row":4,"col":17,"symbol":3},{"xh":83,"row":4,"col":18,"symbol":3},{"xh":84,"row":4,"col":19,"symbol":3},{"xh":85,"row":4,"col":20,"symbol":3},{"xh":86,"row":4,"col":21,"symbol":3},{"xh":87,"row":4,"col":22,"symbol":3},{"xh":88,"row":5,"col":1,"symbol":3},{"xh":89,"row":5,"col":2,"symbol":3},{"xh":90,"row":5,"col":3,"symbol":3},{"xh":91,"row":5,"col":4,"symbol":3},{"xh":92,"row":5,"col":5,"symbol":3},{"xh":93,"row":5,"col":6,"symbol":3},{"xh":94,"row":5,"col":7,"symbol":2},{"xh":95,"row":5,"col":8,"symbol":3},{"xh":96,"row":5,"col":9,"symbol":3},{"xh":97,"row":5,"col":10,"symbol":3},{"xh":98,"row":5,"col":11,"symbol":3},{"xh":99,"row":5,"col":12,"symbol":3},{"xh":100,"row":5,"col":13,"symbol":3},{"xh":101,"row":5,"col":14,"symbol":3},{"xh":102,"row":5,"col":15,"symbol":3},{"xh":103,"row":5,"col":16,"symbol":2},{"xh":104,"row":5,"col":17,"symbol":3},{"xh":105,"row":5,"col":18,"symbol":3},{"xh":106,"row":5,"col":19,"symbol":3},{"xh":107,"row":5,"col":20,"symbol":3},{"xh":108,"row":5,"col":21,"symbol":3},{"xh":109,"row":5,"col":22,"symbol":3},{"xh":110,"row":6,"col":1,"symbol":3},{"xh":111,"row":6,"col":2,"symbol":3},{"xh":112,"row":6,"col":3,"symbol":3},{"xh":113,"row":6,"col":4,"symbol":3},{"xh":114,"row":6,"col":5,"symbol":3},{"xh":115,"row":6,"col":6,"symbol":3},{"xh":116,"row":6,"col":7,"symbol":2},{"xh":117,"row":6,"col":8,"symbol":3},{"xh":118,"row":6,"col":9,"symbol":3},{"xh":119,"row":6,"col":10,"symbol":3},{"xh":120,"row":6,"col":11,"symbol":3},{"xh":121,"row":6,"col":12,"symbol":3},{"xh":122,"row":6,"col":13,"symbol":3},{"xh":123,"row":6,"col":14,"symbol":3},{"xh":124,"row":6,"col":15,"symbol":3},{"xh":125,"row":6,"col":16,"symbol":2},{"xh":126,"row":6,"col":17,"symbol":3},{"xh":127,"row":6,"col":18,"symbol":3},{"xh":128,"row":6,"col":19,"symbol":3},{"xh":129,"row":6,"col":20,"symbol":3},{"xh":130,"row":6,"col":21,"symbol":3},{"xh":131,"row":6,"col":22,"symbol":3},{"xh":132,"row":7,"col":1,"symbol":3},{"xh":133,"row":7,"col":2,"symbol":3},{"xh":134,"row":7,"col":3,"symbol":3},{"xh":135,"row":7,"col":4,"symbol":3},{"xh":136,"row":7,"col":5,"symbol":3},{"xh":137,"row":7,"col":6,"symbol":3},{"xh":138,"row":7,"col":7,"symbol":2},{"xh":139,"row":7,"col":8,"symbol":3},{"xh":140,"row":7,"col":9,"symbol":3},{"xh":141,"row":7,"col":10,"symbol":3},{"xh":142,"row":7,"col":11,"symbol":3},{"xh":143,"row":7,"col":12,"symbol":3},{"xh":144,"row":7,"col":13,"symbol":3},{"xh":145,"row":7,"col":14,"symbol":3},{"xh":146,"row":7,"col":15,"symbol":3},{"xh":147,"row":7,"col":16,"symbol":2},{"xh":148,"row":7,"col":17,"symbol":3},{"xh":149,"row":7,"col":18,"symbol":3},{"xh":150,"row":7,"col":19,"symbol":3},{"xh":151,"row":7,"col":20,"symbol":3},{"xh":152,"row":7,"col":21,"symbol":3},{"xh":153,"row":7,"col":22,"symbol":3}]};
  ryFz = {
    Data: [
      { mtgid: "1", ryfzid: "93", ryfzname: "领导组" },
      { mtgid: "1", ryfzid: "141", ryfzname: "员工组" }
    ],
    Message: "查询成功"
  };
  ryfzUser = {
    Data: [
      { xh: "1", ryfzid: "93", useruuid: "4", name: "王倩" },
      { xh: "2", ryfzid: "93", useruuid: "4", name: "王倩A" },
      { xh: "3", ryfzid: "93", useruuid: "4", name: "王倩B" },
      { xh: "4", ryfzid: "93", useruuid: "4", name: "王倩C" },
      { xh: "5", ryfzid: "93", useruuid: "3", name: "张鹏" },
      { xh: "6", ryfzid: "93", useruuid: "7", name: "郭轶敏" },
      { xh: "7", ryfzid: "93", useruuid: "1", name: "韩丽雅" },
      { xh: "8", ryfzid: "93", useruuid: "8", name: "侯婷" },
      { xh: "9", ryfzid: "93", useruuid: "8", name: "侯婷A" },
      { xh: "10", ryfzid: "93", useruuid: "8", name: "侯婷B" },
      { xh: "11", ryfzid: "93", useruuid: "8", name: "侯婷C" },
      { xh: "12", ryfzid: "93", useruuid: "2", name: "徐健" },
      { xh: "13", ryfzid: "93", useruuid: "5", name: "张志伟" },
      { xh: "14", ryfzid: "93", useruuid: "6", name: "新闻中心" }
    ],
    Message: "查询成功"
  };
  //获取该会议的人员分组情况
  // function getRyfz(mtgid){
  //     $.ajax({
  //         type: 'post',
  //         contentType: "application/x-www-form-urlencoded; charset=utf-8",
  //         url: 'http://192.168.160.80:8080/mtgp/seating_queryPxRyfz?mtgid='+arrTable.mtgid,
  //         async:false,
  //         dataType:'json',
  //         data:mtgid,
  //         success: function(data){
  //             if (data){
  //                ryFz=data;
  //             }
  //         }
  //     });
  // }
  // getRyfz(arrTable.mtgid)

  //根据人员分组的唯一标识获取该分组下的人员信息
	// function getRyfzUser(ryfzid){
	// 	$.ajax({                 	   
	//         type: 'post',
	// 		    contentType: "application/x-www-form-urlencoded; charset=utf-8", 
	//         url: '<%=basePath%>seating_queryPxRyfzUsers?ryfzid='+ryfzid,
	//         async:false,
  //         dataType:'json',
  //         data: ryfzid,
	//         success: function(data){
  //         if (data){
  //           ryfzUser=data;
  //         }
  //       }
  //     });	
	// }
  creatSeat();
  disPlay();
});
